<?php
namespace app\home\controller;

use think\Log;
class Index extends Base
{
    public function index()
    {
        echo "欢迎进入首页！";
        //Log::write("欢迎进入首页","error");
        //$wechat=new Wechat();
        //$this->redirect($wechat->get_authorize_url(1));
    }

    public function home(){
        $wechat=new Wechat();
        $token=$wechat->get_access_token($_GET["code"]);

        $user_info = $wechat->get_user_info($token['access_token'],$token['openid']); //获取用户信息
        print_r($user_info);
    }
}
